// 交易市场-水产品独立接口  以及 交易市场行情根据日期查询等；
import request from '@/utils/request'

export default{
  /**
   * @description: 添加 *代表必填
   * @param {Object} params *
   * @return {Object}
   */
   add(params){
    const url = "/socialized-market/goodsInMarket/add"
    return request.post(url,{...params})
  },

  /**
   * @description: 根据id删除 *代表必填
   * @param {String/Number} goodsInMarketId *
   * @return {Object}
   */
   delById(id){
    const url = "/socialized-market/goodsInMarket/del?goodsInMarketId="+id
    return request.delete(url)
  },

  /**
   * @description: 根据id批量删除 *代表必填
   * @param {String/Number} goodsInMarketIdList *
   * @return {Object}
   */
   delListById(idList){
     const url = `/socialized-market/goodsInMarket/delList?goodsInMarketIdList=${idList}`
     return request.delete(url)
   },

  /**
   * @description: 根据商品种类和市场查询 *代表必填
   * @param {String/Number} staffId *
   * @return {Object}
   */
   queryByMarketAndGoods(params){
    const url = "/socialized-market/goodsInMarket/queryByMarketAndGoods"
    return request.post(url,{...params})
  },

  /**
   * @description: 根据市场查询所有商品行情 *代表必填
   * @param {Object} params *
   */
   queryByMarketId(id){
    // const url = "/socialized-market/goodsInMarket/queryByMarketId"
    const url = "/socialized-market/goodsInMarket/queryByMarketId?marketId="+id
    // return request.get(url,params)
    return request.get(url)
  },

  // 商品行情（excle原始数据）- 交易市场行情根据日期查询 application/x-www-form-urlencoded
  /**
   * @description: 交易市场行情根据日期查询 *代表必填
   * @param  marketId  *
   * @param  goodsId   *
   */
   queryByDate(id){ 
    const url = `/socialized-market/marketQuotation/queryByDate?goodsInMarketId=${id}`
    return request.get(url)
  },

}
